package com.intcast;

import java.util.Random;

/*
要写注释哦!!!
*/
public class Demo04 {
    public static void main(String[] args) {
        String resout = checkCode(5);
        System.out.println(resout);

    }

    public static String checkCode(int count) {
        String str = "";
        int num = 0;
        Random r = new Random();
        while (num != count) {
            char c = (char) (r.nextInt('z' - '0' + 1) + '0');
            if ((c >= 0 && c <= 9) || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
                str += c;
                num++;
            }
        }
        return str;
    }
}
